package top.suyarong.ftbqsync.cmd;

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import top.suyarong.ftbqsync.FTBQSync;
import top.suyarong.ftbqsync.utils.LogUtil;
import top.suyarong.ftbqsync.utils.NMSUtil;

public class FTBQCommands implements CommandExecutor {

    private static final LogUtil log = LogUtil.getInstance();

    private static final FTBQSync plugin = FTBQSync.getInstance();

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (!(sender instanceof Player)) return false;
        Player player = (Player) sender;
        if (args.length == 1 && args[0].equalsIgnoreCase("getInfo")) {
            Object nmsPlayer = NMSUtil.getNMSPlayer(player);
            log.message(player, "玩家信息为 {0}", nmsPlayer);
            return true;
        }
        return false;
    }
}
